package com.usian.admin.controller;

import com.usian.admin.service.AdSensitivesService;
import com.usian.apis.admin.AdSensitivesControllerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/api/v1/adSensitive")
@RestController
public class AdSensitiveController implements AdSensitivesControllerApi {
    @Autowired
    private AdSensitivesService adSensitivesService;

    @PostMapping("findPage")
    @Override
    public ResponseResult findByIdAndPage(@RequestBody SensitiveDto sensitiveDto) {
        return adSensitivesService.findByIdAndPage(sensitiveDto);
    }

    @PostMapping("add")
    @Override
    public ResponseResult add(@RequestBody AdSensitive adSensitive) {
        return adSensitivesService.add(adSensitive);
    }
    @PostMapping("update")
    @Override
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitivesService.update(adSensitive);
    }

    @GetMapping("delete/{id}")
    @Override
    public ResponseResult delete(@PathVariable Integer id) {
        return adSensitivesService.delete(id);
    }
}
